package org.hot100_5.leetcode206;

import org.leetcode.easy.ListNode;

import java.util.List;

public class Solution {
    public ListNode reverseList(ListNode head) {

        ListNode pre = null;
        ListNode next = null;

        while (head!=null){
            next = head.next;

            head.next = pre;

            pre = head;

            head = next;
        }

        return pre;
    }
}
